package com.prs.crm.report;

import java.awt.Color;
import java.util.Map;

/**
 * 报表单元格
 * @author prs.chenzhi
 *
 */
public class ReportCell implements java.io.Serializable{

	private static final long serialVersionUID = 1L;
	
	public final static int ALIGN_LEFT = 1; 
	
	public final static int ALIGN_RIGHT = 2;
	
	public final static int ALIGN_CENTER = 3;
	
	/**
	 * 单元格名称,表示表头
	 */
	private String name;
	
	/**
	 * 属性来源
	 */
	private String property;
	
	/**
	 * 格式
	 */
	private String format;
	
	/**
	 * 宽度定义
	 */
	private Integer width;
	
	/**
	 * 水平对齐
	 */
	private Integer align = ALIGN_CENTER;
	
	/**
	 * 单元格背景色
	 */
	private Color backgroundColor = Color.white;
	
	/**
	 * 字体颜色
	 */
	private Color fontColor = Color.black;
	
	/**
	 * 边框颜色
	 */
	private Color borderColor = Color.black;
	
	
	private Map<String, String> map;
	
	/**
	 * 单位 如 $ % ￥
	 * */
	private char suffix;
	
	
	public ReportCell(String name,String property)
	{
		this.setName(name);
		if(property==null){
			this.setProperty("");
			
		}else{
		this.setProperty(property);}
	}

	public ReportCell(String name,String property, Map<String, String> map)
	{
		this.setName(name);
		this.setProperty(property);
		this.setMap(map);
	}
	
	public ReportCell(String name,String property, char suffix)
	{
		this.setName(name);
		this.setProperty(property);
		this.setSuffix(suffix);
	}
	
	public ReportCell(String name,String property,String format)
	{
		this.setName(name);
		this.setProperty(property);
		this.setFormat(format);
	}
	public void setName(String name) {
		this.name = name;
	}


	public String getName() {
		return name;
	}


	public void setProperty(String property) {
		this.property = property;
	}


	public String getProperty() {
		return property;
	}


	public void setFormat(String format) {
		this.format = format;
	}


	public String getFormat() {
		return format;
	}

	public void setWidth(Integer width) {
		this.width = width;
	}

	public Integer getWidth() {
		return width;
	}

	public void setAlign(Integer align) {
		this.align = align;
	}

	public Integer getAlign() {
		return align;
	}

	public void setBackgroundColor(Color backgroundColor) {
		this.backgroundColor = backgroundColor;
	}

	public Color getBackgroundColor() {
		return backgroundColor;
	}

	public void setFontColor(Color fontColor) {
		this.fontColor = fontColor;
	}

	public Color getFontColor() {
		return fontColor;
	}

	public void setBorderColor(Color borderColor) {
		this.borderColor = borderColor;
	}

	public Color getBorderColor() {
		return borderColor;
	}

	public Map<String, String> getMap() {
		return map;
	}

	public void setMap(Map<String, String> map) {
		this.map = map;
	}

	public char getSuffix() {
		return suffix;
	}

	public void setSuffix(char suffix) {
		this.suffix = suffix;
	}
	
	
}
